|
Command: |
Generate an HMAC on a Block of Data. |
|
Notes: |
Use of this command requires the optional User Authentication licence. Error code 67 will be returned if the command is not licenced. Currently, SHA-1 is the only supported hash algorithm.
|
|
Field |
Length & Type |
Details |
|
COMMAND MESSAGE |
||
|
Message header |
m A |
(Subsequently returned to the Host unchanged). |
|
Command Code |
2 A |
Value "LQ" |
|
Hash Identifier |
2 N |
Identifier of the Hash Algorithm. Currently only SHA-1 is supported · 01 = SHA-1 |
|
HMAC Length |
4 N |
Length (t) in bytes of the output HMAC Must satisfy (L/2 £ t £ L), where L is the size of the hash function output (so L = 20 in the case of SHA-1), unless the Minimum HMAC Length has been configured otherwise using the "CS" (Configure Security) command |
|
HMAC Key Block Format |
2 N |
Defines the format of the stored key. Currently only format 00 is supported · 00 = format defined |
|
HMAC Key Length |
4 N |
Length (in bytes) of the next field |
|
HMAC Key |
n B |
The HMAC Key, encrypted under LMK pair 34-35 variant 1 |
|
Delimiter |
1 A |
Value ";" |
|
Data Length |
5 N |
Length of message to be authenticated |
|
Message Data |
n B |
Data to be authenticated |
|
End message delimiter |
1 C |
Optional. Must be present if a message trailer is present. Value X’19. |
|
Message trailer |
n A |
Optional. Maximum length 32 characters. |
|
Field |
Length & Type |
Details | |
|
RESPONSE MESSAGE |
|||
|
Message header |
m A |
Returned to the Host unchanged. |
|
|
Response code |
2 A |
Value "LR" |
|
|
Error code |
2 N |
00 : No error 04 : HMAC Length error 05 : Invalid Hash Identifier 06 : Invalid Key Usage 07 : Invalid Key Block Format 08 : HMAC Key Block error 12 : No keys loaded in user storage 13 : LMK error; report to supervisor 15 : Error in input data 21 : Invalid user storage index 47 : DSP error; report to supervisor 80 : HMAC Key Length error 81 : Data Length error
|
|
|
HMAC Length |
4 N |
Length (t) in bytes of output HMAC, as defined in command message |
|
|
HMAC |
n B |
HMAC (length as defined in the previous field). |
|
|
End message delimiter |
1 C |
Present only if supplied in the command message. Value X’19. |
|
|
Message trailer |
n A |
Present only if present in the command message. Maximum length 32 characters. |
|